<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>timer</title>
	<script type="text/javascript">
	window.onload=function  () {
		function runney  () {
		
		now = new Date();

		work = new Date("2017,05,26");

		taday = (work.getTime()-now.getTime())/1000/60/60/24;

		taday1 =Math.floor(taday);

		hours = (taday-taday1)*24;

		hours1 = Math.floor(hours);

		min = (hours-hours1)*60;

		min1 = Math.floor(min);

		sec = (min-min1)*60;

		sec1=Math.floor(sec);

		box1 = document.getElementsByClassName("box1");

		box1[0].innerHTML=taday1;

		box1[1].innerHTML=hours1;

		box1[2].innerHTML=min1;

		box1[3].innerHTML=sec1;
		}

		setInterval(runney,1000);

		an=document.getElementById('an');
		an.onclick = function() {
			location.reload(); 
		}

	}

		




	</script>
	<link rel="stylesheet" href="./css/main.css">
</head>
<body>
	<div class="header">
		<div class="top"><h1>距离你的生日还有</h1></div>
		<div class="box"><div class="box1"></div><i>天</i></div>
		<span>：</span>
		<div class="box"><div class="box1"></div><i>小时</i></div>
		<span>：</span>
		<div class="box"><div class="box1"></div><i>分钟</i></div>
		<span>：</span>
		<div class="box"><div class="box1"></div><i>秒</i></div>
	</div>
		<input type="button" id="an" value="刷新">
</body>
</html>